<!--
 * @Author: wangming
 * @Date: 2021-04-23 13:45:32
 * @LastEditors: wangming
 * @LastEditTime: 2021-10-08 17:16:59
 * @Description: file content
-->
<route>
{
  "meta":{
    "title":"个人中心",
    "localism": "sys.user_center"
  }
}
</route>
<template>
  <div class="ks-row hmax layoutbox">
    <tabNav
      :list="list"
      class="w200 hmax ovya bgwh mr20"
      v-model="tabvalue"
    ></tabNav>
    <div class="ks-col hmax ovya bgwh">
      <component :is="tabvalue"></component>
    </div>
  </div>
</template>

<script>
import templates from "../__components__/index";
import { mapGetters } from "vuex";
import { browser } from "@/utils/browser";
export default {
  components: { ...templates },
  data() {
    return {
      tabvalue: "basics",
    };
  },
  computed: {
    ...mapGetters(["MOS_ENABLED"]),
    list() {
      const arr = [
        {
          label: this.$t("sys.basic_information"),
          value: "basics",
        },
      ];
      let { wxwork, dingtalk } = browser.versions;
      if (!this.MOS_ENABLED && !wxwork && !dingtalk) {
        arr.push({
          label: this.$t("sys.security_setting"),
          value: "security",
        });
      }
      arr.push({
        label: this.$t("sys.working_shift"),
        value: "shift",
      });
      return arr;
    },
  },
  mounted(){
    const tabItem = this.$route.query?.tabvalue
    if(tabItem){
      this.tabvalue = tabItem
    }
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.hmax {
  height: 100%;
}
</style>
